var settings = require("../settings");
var mongoose = require('mongoose');

mongoose.connect('mongodb://' + settings.host + '/' +settings.db);

var db = mongoose.connection;

db.on('error',console.error.bind(console,'connect err:'));

var userSchema = mongoose.Schema({
       username:String,
       password:String,
});

var blogSchema = mongoose.Schema({
	username:String,
    	title:String,
    	date:Date,
    	content:String,
});



exports.blogSchema = db.model('blog',blogSchema);
exports.userSchema = db.model('user',userSchema);
